from action.pt.order_manage import LookOrderAction
from testcases.login_tool import LoginTool
from utils.api_util import Session
from utils.base_util import CommonUtils
from utils.testcase import TestCase


class LookOrderTest(TestCase):
    '''
    查看订单测试类
    '''

    def setup(self):
        self.loa = LookOrderAction()
        self.session = LoginTool.login_pt()

    def teardown(self):
        Session.close_session()

    def test_query_by_parkingid(self):

        #获取测试数据
        datas = CommonUtils.read_excel(section="look_order", option="parkingid")
        for data in datas:
            print(data)
            #发送请求
            resp = self.loa.do_query_by_parkingid(data=data['params'])
            #断言

            print(resp.text)
            result = self.loa.success_or_failed(resp.text)
            print(result)
            print()
            self.assert_equal(data,result)

if __name__ == '__main__':
    lot = LookOrderTest()
    lot.setup()
    lot.test_query_by_parkingid()
    lot.teardown()

    # if "case_no" in data:
    #     case_id = data["case_no"]
    # if "params" in data:
    #     params = data["params"]
    # if "expected" in data:
    #     expected = data["expected"]
    # if "test_type" in data:
    #     type = data["test_type"]
    # if "test_steps" in data:
    #     step = data["test_steps"]
    # if "version" in data:
    #     version_id = data["version"]
    # if "module" in data:
    #     module_name = data["module"]